package com.czk.ssarag.config;

import com.alibaba.cloud.ai.dashscope.embedding.DashScopeEmbeddingModel;
import org.springframework.ai.vectorstore.SimpleVectorStore;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: chenzhangkun
 * @CreateTime: 2025-05-15
 * @Description: springAI的SimpleVectorStore的配置
 * @Version: 1.0
 */
@Configuration
public class SimpleVectorStoreConfig {
    /**
     * @return org.springframework.ai.vectorstore.VectorStore
     * @Author chenzhangkun
     * @Description spring内置向量库，基于内存实现的
     * @Date 22:37 2025/5/15
     * @Param [embeddingModel] openAI的向量大模型类，这里用的是阿里云的百炼平台向量大模型
     **/
    @Bean(name = "simpleVectorStore")
    public VectorStore simpleVectorStore(DashScopeEmbeddingModel embeddingModel) {
        return SimpleVectorStore.builder(embeddingModel).build();
    }
}
